package com.cash.lemoloan.statisticlib.model;

import android.annotation.SuppressLint;
import android.content.Context;
import android.telephony.TelephonyManager;


import com.cash.lemoloan.statisticlib.StatisticApplication;
import com.cash.lemoloan.statisticlib.StatisticContant;

import java.io.Serializable;

import com.cash.lemoloan.statisticlib.Utils.AppInfoUtils;
import com.cash.lemoloan.statisticlib.Utils.DevicesUtil;


public class StatisticBaseUploadInfo<T> implements Serializable {

    private String statisticuserGid;
    private String statistictype;
    private String statisticappid;
    private String statisticswv;
    private String statisticwifimac;
    private String statisticlatitude;
    private String statisticlongitude;
    private String statisticip;
    private String statisticimei;
    private String statisticphoneNum;
    private String statisticreportType;
    private String statisticreqId;
    private String statistictotalSize;
    private String statistictotalPage;
    private String statisticcurrPage;
    private String statisticreqChannel;
    private T data;

    public StatisticBaseUploadInfo(String mid){
        this.statistictype = mid;
        this.statisticuserGid = StatisticContant.NEW_CASHUSER_GID;
        this.statisticappid = "VayMe";
        this.statisticswv = AppInfoUtils.getVersionName(StatisticApplication.getInstance());
        this.statisticwifimac = DevicesUtil.getMacAddress();
        this.statisticlatitude = StatisticContant.latitude;
        this.statisticlongitude = StatisticContant.longitude;
        try {
            TelephonyManager mTelephonyMgr = (TelephonyManager)StatisticApplication.getInstance().getSystemService(Context.TELEPHONY_SERVICE);
            @SuppressLint("MissingPermission") String num = mTelephonyMgr.getLine1Number();
            this.statisticphoneNum = num;
        }catch (Exception e){

        }

        if(DevicesUtil.isWifiAvailable()){
            this.statisticip = DevicesUtil.getRouterIPAddress();
        }else{
            this.statisticip = DevicesUtil.getLocalIPV4Address();
        }
        this.statisticimei = DevicesUtil.getIMei();
        this.statisticreportType = "f";
        this.statisticreqChannel = "VM";

    }

    public String getPhoneNum() {
        return statisticphoneNum;
    }

    public void setPhoneNum(String phoneNum) {
        this.statisticphoneNum = phoneNum;
    }

    public String getUserGid() {
        return statisticuserGid;
    }

    public void setUserGid(String userGid) {
        this.statisticuserGid = userGid;
    }

    public String getType() {
        return statistictype;
    }

    public void setType(String type) {
        this.statistictype = type;
    }

    public String getAppid() {
        return statisticappid;
    }

    public void setAppid(String appid) {
        this.statisticappid = appid;
    }

    public String getSwv() {
        return statisticswv;
    }

    public void setSwv(String swv) {
        this.statisticswv = swv;
    }

    public String getWifimac() {
        return statisticwifimac;
    }

    public void setWifimac(String wifimac) {
        this.statisticwifimac = wifimac;
    }

    public String getLatitude() {
        return statisticlatitude;
    }

    public void setLatitude(String latitude) {
        this.statisticlatitude = latitude;
    }

    public String getLongitude() {
        return statisticlongitude;
    }

    public void setLongitude(String longitude) {
        this.statisticlongitude = longitude;
    }

    public String getIp() {
        return statisticip;
    }

    public void setIp(String ip) {
        this.statisticip = ip;
    }

    public String getImei() {
        return statisticimei;
    }

    public void setImei(String imei) {
        this.statisticimei = imei;
    }

    public String getReportType() {
        return statisticreportType;
    }

    public void setReportType(String reportType) {
        this.statisticreportType = reportType;
    }

    public String getReqId() {
        return statisticreqId;
    }

    public void setReqId(String reqId) {
        this.statisticreqId = reqId;
    }

    public String getTotalPage() {
        return statistictotalPage;
    }

    public void setTotalPage(String totalPage) {
        this.statistictotalPage = totalPage;
    }

    public String getCurrPage() {
        return statisticcurrPage;
    }

    public void setCurrPage(String currPage) {
        this.statisticcurrPage = currPage;
    }

    public String getTotalSize() {
        return statistictotalSize;
    }

    public void setTotalSize(String totalSize) {
        this.statistictotalSize = totalSize;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "BaseUploadInfo{" +
                "statisticuserGid='" + statisticuserGid + '\'' +
                ", statistictype='" + statistictype + '\'' +
                ", statisticappid='" + statisticappid + '\'' +
                ", statisticswv='" + statisticswv + '\'' +
                ", statisticwifimac='" + statisticwifimac + '\'' +
                ", statisticlatitude='" + statisticlatitude + '\'' +
                ", statisticlongitude='" + statisticlongitude + '\'' +
                ", statisticip='" + statisticip + '\'' +
                ", statisticimei='" + statisticimei + '\'' +
                ", statisticphoneNum='" + statisticphoneNum + '\'' +
                ", statisticreportType='" + statisticreportType + '\'' +
                ", statisticreqId='" + statisticreqId + '\'' +
                ", statistictotalSize='" + statistictotalSize + '\'' +
                ", statistictotalPage='" + statistictotalPage + '\'' +
                ", statisticcurrPage='" + statisticcurrPage + '\'' +
                ", data=" + data +
                '}';
    }
}
